<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>Consultoria OnLine: Controle: Saúde e Segurança no Trabalho / Alvarás / Licenças » \FORMATAR</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Consultoria OnLine: Controle: Saúde e Segurança no Trabalho / Alvarás / Licenças</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">0</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">0</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods</li>
<li class="method public "><a href="#Dias" title="Dias :: Calcula a diferença entre duas datas em dias"><span class="description">Calcula a diferença entre duas datas em dias</span><pre>Dias()</pre></a></li>
<li class="method public "><a href="#__construct" title="__construct :: Construtor da classe FORMATAR"><span class="description">Construtor da classe FORMATAR</span><pre>__construct()</pre></a></li>
<li class="method public "><a href="#__destructed" title="__destructed :: Destrutor da Classe FORMATAR"><span class="description">Destrutor da Classe FORMATAR</span><pre>__destructed()</pre></a></li>
<li class="method public "><a href="#cep" title="cep :: Remove máscara de CEP"><span class="description">Remove máscara de CEP</span><pre>cep()</pre></a></li>
<li class="method public "><a href="#cnpj" title="cnpj :: Aplica e remove máscara de CNPJ."><span class="description">Aplica e remove máscara de CNPJ.</span><pre>cnpj()</pre></a></li>
<li class="method public "><a href="#converter_texto" title="converter_texto :: Converter um texto passado do Padrão ISO para UTF-8 e vice e versa"><span class="description">Converter um texto passado do Padrão ISO para UTF-8 e vice e versa</span><pre>converter_texto()</pre></a></li>
<li class="method public "><a href="#cpf" title="cpf :: Aplica e remove máscara de CPF."><span class="description">Aplica e remove máscara de CPF.</span><pre>cpf()</pre></a></li>
<li class="method public "><a href="#cpf_cnpj" title="cpf_cnpj :: Aplica máscara para CPF e CNPJ."><span class="description">Aplica máscara para CPF e CNPJ.</span><pre>cpf_cnpj()</pre></a></li>
<li class="method public "><a href="#data_conv" title="data_conv :: Formata uma data."><span class="description">Formata uma data.</span><pre>data_conv()</pre></a></li>
<li class="method public "><a href="#data_extenso" title="data_extenso :: Escreve uma data por extenso."><span class="description">Escreve uma data por extenso.</span><pre>data_extenso()</pre></a></li>
<li class="method public "><a href="#data_hoje" title="data_hoje :: Retorno o dia de hoje formatado para utilização no sistema."><span class="description">Retorno o dia de hoje formatado para utilização no sistema.</span><pre>data_hoje()</pre></a></li>
<li class="method public "><a href="#extenso" title="extenso :: Escreve um número por extenso, considerando moeda ou não"><span class="description">Escreve um número por extenso, considerando moeda ou não</span><pre>extenso()</pre></a></li>
<li class="method public "><a href="#hoje" title="hoje :: Retorno o dia de hoje formatado para impressão e por extenso."><span class="description">Retorno o dia de hoje formatado para impressão e por extenso.</span><pre>hoje()</pre></a></li>
<li class="method public "><a href="#periodo" title="periodo :: Calcula data inicial e final de um período informado"><span class="description">Calcula data inicial e final de um período informado</span><pre>periodo()</pre></a></li>
<li class="method public "><a href="#placa" title="placa :: Aplica e remove máscara para placas."><span class="description">Aplica e remove máscara para placas.</span><pre>placa()</pre></a></li>
<li class="method public "><a href="#telefone" title="telefone :: Remove máscara de telefone."><span class="description">Remove máscara de telefone.</span><pre>telefone()</pre></a></li>
<li class="method public "><a href="#texto_maiusculo" title="texto_maiusculo :: Converter um texto passado para maiúsculo."><span class="description">Converter um texto passado para maiúsculo.</span><pre>texto_maiusculo()</pre></a></li>
<li class="method public "><a href="#valor_conv" title="valor_conv :: Converte um valor passado formatando-o"><span class="description">Converte um valor passado formatando-o</span><pre>valor_conv()</pre></a></li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties</li>
<li class="property public "><a href="#%24ano" title="$ano :: Guarda o ano"><span class="description">Guarda o ano</span><pre>$ano</pre></a></li>
<li class="nav-header private">» Private</li>
<li class="property private "><a href="#%24d_semana" title="$d_semana :: Guarda o dia da semana"><span class="description">Guarda o dia da semana</span><pre>$d_semana</pre></a></li>
<li class="property private "><a href="#%24dia" title="$dia :: Guarda o dia"><span class="description">Guarda o dia</span><pre>$dia</pre></a></li>
<li class="property private "><a href="#%24mes" title="$mes :: Guarda o mês"><span class="description">Guarda o mês</span><pre>$mes</pre></a></li>
<li class="property private "><a href="#%24meses" title="$meses :: Guarda os meses do ano por extenso"><span class="description">Guarda os meses do ano por extenso</span><pre>$meses</pre></a></li>
<li class="property private "><a href="#%24semana" title="$semana :: Guarda os dias da semana por extenso"><span class="description">Guarda os dias da semana por extenso</span><pre>$semana</pre></a></li>
</ul>
</div>
<div class="span8">
<a name="%5CFORMATAR" id="\FORMATAR"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/global.html">global</a></li>
<li class="active">
<span class="divider">\</span><a href="../classes/FORMATAR.html">FORMATAR</a>
</li>
</ul>
<div href="../classes/FORMATAR.html" class="element class">
<p class="short_description">Classe de formatação</p>
<div class="details">
<p class="long_description"></p>
<table class="table table-bordered">
<tr>
<th>package</th>
<td><a href="../packages/Default.html">Default</a></td>
</tr>
<tr>
<th>return</th>
<td></td>
</tr>
</table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a name="Dias" id="Dias"></a><div class="element clickable method public Dias" data-toggle="collapse" data-target=".Dias .collapse">
<h2>Calcula a diferença entre duas datas em dias</h2>
<pre>Dias(string $inicio, string $fim) : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$inicio</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$fim</h4>
<code>string</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>integer</code>$dias</div>
</div></div>
</div>
<a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
<h2>Construtor da classe FORMATAR</h2>
<pre>__construct() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
</div>
<a name="__destructed" id="__destructed"></a><div class="element clickable method public __destructed" data-toggle="collapse" data-target=".__destructed .collapse">
<h2>Destrutor da Classe FORMATAR</h2>
<pre>__destructed() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
</div>
<a name="cep" id="cep"></a><div class="element clickable method public cep" data-toggle="collapse" data-target=".cep .collapse">
<h2>Remove máscara de CEP</h2>
<pre>cep(string $cep, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$cep</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$cep</div>
</div></div>
</div>
<a name="cnpj" id="cnpj"></a><div class="element clickable method public cnpj" data-toggle="collapse" data-target=".cnpj .collapse">
<h2>Aplica e remove máscara de CNPJ.</h2>
<pre>cnpj(string $cnpj, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$cnpj</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$cnpj</div>
</div></div>
</div>
<a name="converter_texto" id="converter_texto"></a><div class="element clickable method public converter_texto" data-toggle="collapse" data-target=".converter_texto .collapse">
<h2>Converter um texto passado do Padrão ISO para UTF-8 e vice e versa</h2>
<pre>converter_texto(string $texto, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$texto</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$texto</div>
</div></div>
</div>
<a name="cpf" id="cpf"></a><div class="element clickable method public cpf" data-toggle="collapse" data-target=".cpf .collapse">
<h2>Aplica e remove máscara de CPF.</h2>
<pre>cpf(string $cpf, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$cpf</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$cpf</div>
</div></div>
</div>
<a name="cpf_cnpj" id="cpf_cnpj"></a><div class="element clickable method public cpf_cnpj" data-toggle="collapse" data-target=".cpf_cnpj .collapse">
<h2>Aplica máscara para CPF e CNPJ.</h2>
<pre>cpf_cnpj(string $valor, integer $tipo, integer $modo) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$valor</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$tipo</h4>
<code>integer</code>
</div>
<div class="subelement argument">
<h4>$modo</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$retorno</div>
</div></div>
</div>
<a name="data_conv" id="data_conv"></a><div class="element clickable method public data_conv" data-toggle="collapse" data-target=".data_conv .collapse">
<h2>Formata uma data.</h2>
<pre>data_conv(string $data, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$data</div>
</div></div>
</div>
<a name="data_extenso" id="data_extenso"></a><div class="element clickable method public data_extenso" data-toggle="collapse" data-target=".data_extenso .collapse">
<h2>Escreve uma data por extenso.</h2>
<pre>data_extenso(string $data) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code>
</div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a name="data_hoje" id="data_hoje"></a><div class="element clickable method public data_hoje" data-toggle="collapse" data-target=".data_hoje .collapse">
<h2>Retorno o dia de hoje formatado para utilização no sistema.</h2>
<pre>data_hoje() : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a name="extenso" id="extenso"></a><div class="element clickable method public extenso" data-toggle="collapse" data-target=".extenso .collapse">
<h2>Escreve um número por extenso, considerando moeda ou não</h2>
<pre>extenso(float $valor, integer $tipo, integer $caixa) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$valor</h4>
<code>float</code>
</div>
<div class="subelement argument">
<h4>$tipo</h4>
<code>integer</code>
</div>
<div class="subelement argument">
<h4>$caixa</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$rt</div>
</div></div>
</div>
<a name="hoje" id="hoje"></a><div class="element clickable method public hoje" data-toggle="collapse" data-target=".hoje .collapse">
<h2>Retorno o dia de hoje formatado para impressão e por extenso.</h2>
<pre>hoje() : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a name="periodo" id="periodo"></a><div class="element clickable method public periodo" data-toggle="collapse" data-target=".periodo .collapse">
<h2>Calcula data inicial e final de um período informado</h2>
<pre>periodo(string $mesano) : mixed[]</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$mesano</h4>
<code>string</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed[]</code>$data</div>
</div></div>
</div>
<a name="placa" id="placa"></a><div class="element clickable method public placa" data-toggle="collapse" data-target=".placa .collapse">
<h2>Aplica e remove máscara para placas.</h2>
<pre>placa(string $placa, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$placa</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$placa</div>
</div></div>
</div>
<a name="telefone" id="telefone"></a><div class="element clickable method public telefone" data-toggle="collapse" data-target=".telefone .collapse">
<h2>Remove máscara de telefone.</h2>
<pre>telefone(string $tel, integer $cod) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$tel</h4>
<code>string</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$tel</div>
</div></div>
</div>
<a name="texto_maiusculo" id="texto_maiusculo"></a><div class="element clickable method public texto_maiusculo" data-toggle="collapse" data-target=".texto_maiusculo .collapse">
<h2>Converter um texto passado para maiúsculo.</h2>
<pre>texto_maiusculo(string $texto) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$texto</h4>
<code>string</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>$texto</div>
</div></div>
</div>
<a name="valor_conv" id="valor_conv"></a><div class="element clickable method public valor_conv" data-toggle="collapse" data-target=".valor_conv .collapse">
<h2>Converte um valor passado formatando-o</h2>
<pre>valor_conv(float $valor, integer $cod) : float</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$valor</h4>
<code>float</code>
</div>
<div class="subelement argument">
<h4>$cod</h4>
<code>integer</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>float</code>$valor</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a name="%24ano" id="$ano"> </a><div class="element clickable property public $ano" data-toggle="collapse" data-target=".$ano .collapse">
<h2>Guarda o ano</h2>
<pre>$ano : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>public</td>
</tr></table>
</div></div>
</div>
<a name="%24d_semana" id="$d_semana"> </a><div class="element clickable property private $d_semana" data-toggle="collapse" data-target=".$d_semana .collapse">
<h2>Guarda o dia da semana</h2>
<pre>$d_semana : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>private</td>
</tr></table>
</div></div>
</div>
<a name="%24dia" id="$dia"> </a><div class="element clickable property private $dia" data-toggle="collapse" data-target=".$dia .collapse">
<h2>Guarda o dia</h2>
<pre>$dia : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>private</td>
</tr></table>
</div></div>
</div>
<a name="%24mes" id="$mes"> </a><div class="element clickable property private $mes" data-toggle="collapse" data-target=".$mes .collapse">
<h2>Guarda o mês</h2>
<pre>$mes : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>private</td>
</tr></table>
</div></div>
</div>
<a name="%24meses" id="$meses"> </a><div class="element clickable property private $meses" data-toggle="collapse" data-target=".$meses .collapse">
<h2>Guarda os meses do ano por extenso</h2>
<pre>$meses : mixed[]</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>private</td>
</tr></table>
</div></div>
</div>
<a name="%24semana" id="$semana"> </a><div class="element clickable property private $semana" data-toggle="collapse" data-target=".$semana .collapse">
<h2>Guarda os dias da semana por extenso</h2>
<pre>$semana : string[]</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>access</th>
<td>private</td>
</tr></table>
</div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
            generated on 2012-08-21T00:50:54-04:00.<br></footer></div>
</div>
</body>
</html>
